Creating the CLI command script

Create a UTF-8 encoded text file not exceeding 5 MB with the extension .script containing the commands to be run in your environment of firewalls.

The available executable commands on the CLI console are listed:

To assist you, you may also display CLI commands in the web administration interface of a firewall in order to copy the commands used to perform an action that you wish to reproduce in your script:

  1. Click on the black arrow Arrow to open the events panel at the bottom of a firewall's administration interface to expand the events panel.
  2. Select the menu Options > Show commands.

    Menu Options > Show commands

  3. Perform an action (create an object for example) that you wish to repeat in the script.
  4. Copy the commands that were run to produce the action.
  5. Paste them in your script.

To adapt commands to each firewall, use variables surrounded with the symbol %. To find out which variables to use, please refer to the section Using variables.

Further reading
The public stormshield/sns-scripting repository on GitHub offers ready‑to‑use SNS CLI script examples, designed to be run from SMC to configure and maintain your fleet of firewalls. This repository also includes Python scripts that rely on the SNS API as well as Ansible roles, if you want to further automate deployments beyond native SNS CLI scripts.